<? // users - list of users

// must be admin
if( !$_SESSION['admin'] ) ajax_exit( 'error', "Must be logged in as super user" );

// users
mysql_query( "create or replace view users_v as select
			usr_id, login, name, active, admin, super, substr(login_ts,1,16) as login_ts, substr(logout_ts,1,16) as logout_ts
                        from    users order by active desc, login" );
$usrs =  db_get_rcds( "select * from users_v" );

ajax_exit( 'success', count($usrs).' Users', Array( 'rcds'=>$usrs ) );

exit;

?>
